package basics;

/**
 * 测试类的初始化顺序
 *
 * @Author: zhenzhong.wang
 * @Time: 2018/4/24 10:25
 */
public class Demo4 extends De1 {

  static {
    System.out.println(1);
  }

  static De1 e1 = new De1(2);
  De1 e2 = new De1(3);

  public Demo4() {
    System.out.println(4);
  }

  public static void main(String[] args) {
    new Demo4();
  }
}

class De1 extends De2 {

  static {
    System.out.println("De1 One");
  }

  De2 de2 = new De2();

  public De1(Integer i) {
    System.out.println(i);
  }

  public De1() {
    System.out.println("De1 Two");
  }

}

class De2 {

  static {
    System.out.println("De2 One");
  }

  public De2() {
    System.out.println("De2 Two");
  }
}
